//
//  LTSetViewController.m
//  LocalTravelIPhone
//
//  Created by zheng ji on 14-3-28.
//  Copyright (c) 2014年 jxw. All rights reserved.
//

#import "LTSetViewController.h"

@interface LTSetViewController ()

@end

@implementation LTSetViewController
- (IBAction)clearCache:(UIButton *)sender {
    
    [NSThread detachNewThreadSelector:@selector(clearCache) toTarget:self withObject:nil];
    
   UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提醒" message:@"清除缓存成功！"                                                           delegate:nil  cancelButtonTitle:@"确定" otherButtonTitles:nil,nil];
    [alert show];
    alert=nil;
}
-(void)clearCache{
    
    
    NSFileManager *fileManager=[NSFileManager defaultManager];
    NSString *path=[CommonConfigUtil getImageLocalPath];
    [fileManager removeItemAtPath:path error:nil];
    [fileManager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    
    
    
    NSString *filestorePath=[CommonConfigUtil getFileLocalPath];
    
    [fileManager removeItemAtPath:filestorePath error:nil];
    [fileManager createDirectoryAtPath:filestorePath withIntermediateDirectories:YES attributes:nil error:nil];

    
    
    
    
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
